﻿using AiQiuQuan.Sport.Core;
using AiQiuQuan.Sport.Model.Models;

namespace AiQiuQuan.Sport.WebApi.Services
{
    /// <summary>
    /// AccessTokenService
    /// </summary>
    public interface IAccessTokenService : ITransientDependency
    {
        /// <summary>
        /// 微信公众号AccessToken
        /// </summary>
        Task<UnaryResult<TokenDto>> GetWxMpAccessTokenAsync();

        /// <summary>
        /// 微信小程序AccessToken
        /// </summary>
        Task<UnaryResult<TokenDto>> GetWxMiniProgramAccessTokenAsync();

        /// <summary>
        /// 获取微信网页授权URL
        /// </summary>
        /// <param name="callbakcUrl">微信授权成功回调地址(全路径地址)</param>
        /// <param name="scope">snsapi_base(默认)、snsapi_userinfo</param>
        /// <param name="state">授权成功重定向参数，可以填写a-zA-Z0-9的参数值，最多128字节</param>
        Task<string> GetWxWebAuthorizeUrlAsync(string callbakcUrl, string scope = "snsapi_base", string state = "");

        /// <summary>
        /// 获取微信网页token
        /// </summary>
        /// <param name="code">授权成功获得的code</param>
        /// <returns></returns>
        Task<UnaryResult<WxWebTokenDto>> GetWxMpWebAccessTokenAsync(string code);

        /// <summary>
        /// 微信公众号JSSDK TICKET
        /// </summary>
        Task<UnaryResult<JsSdkTicket>> GetWxMpJsSdkTicketAsync();

        /// <summary>
        /// 微信 jssdk config
        /// </summary>
        /// <param name="url">调用jssdk的完整url</param>
        Task<UnaryResult<IDictionary<string, string>>> GetWxJsSdkConfigAsync(string url);

        /// <summary>
        /// 微信小程序登录结果
        /// </summary>
        /// <param name="jsCode">小程序端登录获取的code</param>
        Task<UnaryResult<WxMiniProgramLoginDto>> GetWxMminiProgramLoginResultAsync(string jsCode);
    }
}